package com.qingjiang.projectschedule.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.qingjiang.projectschedule.pojo.*;
import com.qingjiang.projectschedule.pojo.dto.ProjectNodeDelayReasonDTO;
import com.qingjiang.projectschedule.pojo.statistic.ProjectExecution;
import com.qingjiang.projectschedule.pojo.statistic.ProjectLag;
import com.qingjiang.projectschedule.pojo.statistic.ProjectLagList;
import com.qingjiang.projectschedule.utils.Result;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * @author jx
 * @description 针对表【project_information(项目信息表)】的数据库操作Service
 * @createDate 2024-03-15 09:53:46
 */
public interface ProjectInformationService extends IService<ProjectInformation> {

    boolean addOne(ProjectAllInformation projectAllInformation);

    boolean updateProject(ProjectAllInformation projectAllInformation);

    void getExcelTemplate(HttpServletResponse response) throws IOException;

    Result uploadExcel(MultipartFile file);

    Boolean checkProjectIsAdded(String projectName);

    List<ShowProjectAllInformation> query_unfinished();

//    List<ShowProjectAllInformation> queryByCond(ProjectQueryCond projectQueryCond);

    Map<String, Object> queryByCond(ProjectQueryCond projectQueryCond);

    boolean setCurrentNodeid(String projectId, int curNode);

    boolean setIscheck(String projectId, int i);

    boolean setIscancel(String projectId, int i);

    /**
     * 项目实施情况统计查询
     */
    List<ProjectExecution> queryProjectExecution();

    /**
     * 项目滞后情况统计表
     */
    List<ProjectLag> queryProjectLag();

    /**
     * 滞后项目清单
     */
    List<ProjectLagList> queryProjectLagList();

    /**
     * 总项目数量
     */
    int queryProjectNum(int deptId);

    /**
     * 已启动
     */
    int queryProjectNonlock(int deptId);

    /**
     * 已完成
     */
    int queryProjectFinish(int deptId);

    /**
     * 已取消，项目启动后取消
     */
    int queryProjectCancel(int deptId);

    /**
     * 查询单位未完成的项目
     */
    List<ProjectInformation> queryProjectUnfinish(int deptId);

    ProjectInformation queryByProjectID(String projectID);

    Result getLockedProject(Integer page, Integer pageSize);

    Result unLockProject(String projectId);

    Result getProjectStatisticByYearAndMonth(Integer year, Integer month, boolean isSchedule);

    Result getProjectStatisticByYear(Integer year);


    boolean setCardNum(String projectID, int yellow, int red);

    List<Map<String, Object>> getAllProjectByColor(Integer deptId, Integer year, Integer month, String color);

    List<Map<String, Object>> getAllProjectOneYearByColor(Integer deptId, Integer year, String color);

    Map<String, List<ProjectInformation>> getDelayProjectList();

    boolean setCancelReason(NodeOperation operation);

    void updateProjectForFinish();

    void exportProjectByColor(Integer year, Integer month, String color, Integer roleId,Integer deptId, HttpServletResponse response) throws IOException;

    void updateDelayReason(List<ProjectNodeDelayReasonDTO> dtos);
}
